package com.jrx.anytxn.reporting.job.lsFile.step;

import com.jrx.anytxn.reporting.constant.ReportingConstant;
import com.jrx.anytxn.transaction.entity.TlThirdPartyPayment;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 生成还款流水文件 Reader
 *
 * @author liuyang
 * @date 2021-03-13
 */
public class LSThirdPaymentFileReader extends MyBatisPagingItemReader<TlThirdPartyPayment> {
    public LSThirdPaymentFileReader(SqlSessionFactory sqlSessionFactory, Integer pageSize, Date startTime){
        setSaveState(false);
        setPageSize(pageSize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.transaction.mapper.ext.ExtTlThirdPartyPaymentMapper.selectByTypeAndStatus");
        Map<String,Object> map = new HashMap<>();
        map.put("businessDate",startTime);
        map.put("sumStatus", ReportingConstant.PAYMENT_LOG_SUM_STATUS_S);
        setParameterValues(map);
    }
}
